#!/usr/bin/env bash

#set -eo pipefail
#
#git pull
#
#echo 'start local build...'
#
## on macOS grep has not -P option
## java_main_version=$(java --version | tac  | tail -n1 | grep -oP "(?<=jdk)\s(.?)+\s" | awk -F '.' '{print($1)}')
#
##
#java_main_version=$(java --version  |head -n1 | awk '{print $2}' | awk -F '.' '{print $1}')
#
#if [ ${java_main_version} -ge 16  ]; then
#  echo "ok, java main version is ${java_main_version}"
#else
#  echo 'build required at least openjdk16+'
#  exit 1
#fi
#
#mvn clean package

image_full_name="registry.cn-qingdao.aliyuncs.com/x-super/supervision:dev"

docker build -f Dockerfile -t "${image_full_name}" .

# docker push "${image_full_name}"
